package com.gm.beans;

import com.gm.entities.ReeducationConcernantPersonne;
import com.gm.controllers.ReeducationConcernantPersonneFacade;
import java.io.Serializable;
import javax.annotation.PostConstruct;
import javax.inject.Named;
import javax.inject.Inject;
import javax.enterprise.context.SessionScoped;

@Named(value = "reeducationConcernantPersonneController")
@SessionScoped
public class ReeducationConcernantPersonneController extends AbstractController<ReeducationConcernantPersonne> implements Serializable {

    @Inject
    private ReeducationConcernantPersonneFacade ejbFacade;

    public ReeducationConcernantPersonneController() {
        super(ReeducationConcernantPersonne.class);
    }

    @PostConstruct
    public void init() {
        super.setFacade(ejbFacade);
    }

    @Override
    protected void setEmbeddableKeys() {
        this.getSelected().getReeducationConcernantPersonnePK().setIdTypereeducation(this.getSelected().getTypeReeducation().getIdTypereeducation());
        this.getSelected().getReeducationConcernantPersonnePK().setIdPersonne(this.getSelected().getPersonne().getIdPersonne());
    }

    @Override
    protected void initializeEmbeddableKey() {
        this.getSelected().setReeducationConcernantPersonnePK(new com.gm.entities.ReeducationConcernantPersonnePK());
    }
}
